﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;

namespace Framework
{
	public class PrecompiledViewLocationCache : IViewLocationCache
	{
		private readonly string _assemblyName;
		private readonly IViewLocationCache _innerCache;

		public PrecompiledViewLocationCache(string assemblyName, IViewLocationCache innerCache)
		{
			_assemblyName = assemblyName;
			_innerCache = innerCache;
		}

		public string GetViewLocation(HttpContextBase httpContext, string key)
		{
			key = _assemblyName + "::" + key;
			return _innerCache.GetViewLocation(httpContext, key);
		}

		public void InsertViewLocation(HttpContextBase httpContext, string key, string virtualPath)
		{
			key = _assemblyName + "::" + key;
			_innerCache.InsertViewLocation(httpContext, key, virtualPath);
		}
	}

}
